<%@ Page Title="" Language="C#" MasterPageFile="~/PropertyInfo.master" AutoEventWireup="true"
    CodeFile="Comparables.aspx.cs" Inherits="Property_Info_Comparables" %>

<%@ MasterType VirtualPath="~/PropertyInfo.master" %>
<%@ Register Assembly="DevExpress.Web.v9.1, Version=9.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxDataView" TagPrefix="dxdv" %>
<asp:Content ID="ContentHeader" runat="server" ContentPlaceHolderID="HeaderContentPlaceHolder">
    <style type="text/css">
.td1
{
	vertical-align: top;
	width:30%;	
}
.td2
{
	vertical-align: top;
	width:35%;	
}
.label
{
	font-family: Calibri, Verdana, Tahoma, Arial;
	font-size: 9pt;
	font-weight: bolder;
}
.itemStyle, .altItemStyle
{
	border-style: solid;
	border-width: 1px;
	border-color: #ccc #333333 #333333 #ccc;
	float: left;
	display: block;
	width: 92%;
	padding: 10px;
	font-size: 10px;
	overflow: visible;
	height: 125px;
	margin:5px;
	vertical-align:top;
	text-align:left;
}

.itemSeperator
{
	float: left;
	display: block;
	padding-right: 1px;
	border-left-style: dotted;
	border-left-width: 1px;
	border-left-color: #666699;
	height: 181px;
}

.altItemStyle
{
	background-color: #eee;
}

.groupSeperator
{
	clear: left;
	margin-bottom: 1px;
	border-top-style: dotted;
	border-top-width: 1px;
	border-top-color: #666699;
}

.layoutRegion
{
	background-color:White;
}

.headingRegion
{
	background-color: #666666;
	color: #FFFFFF;
	font-size: medium;
	font-weight: bold;
	padding:5px;
}

.subHeading
{
	font-size: small;
}

.photoHeading
{
	font-size: large;
	font-weight: bold;
}

.pagerRegion
{
	clear: left;
	background-color: #999999;
	padding: 5px;
}

.pagerBtn 
{
	font-family:Verdana,Arial;
	font-size:10pt;
}

.footerRegion
{
	background-color: #666666;
	font-family: Arial, Helvetica, sans-serif;
	font-size: xx-small;
	color: #FFFFFF;
	text-align: right;
	padding: 4px;
}

</style>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="SidebarContentPlaceHolder" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContentPlaceHolder" runat="Server">
    <fieldset style="margin-bottom:15px;width: 60%;margin-left:auto;margin-right:auto;">
        <legend>Criteria</legend>
        <div>
            <asp:Label ID="lblDateRange" runat="server" Text="Homes sold in: "></asp:Label>
            <asp:RadioButtonList ID="rblDateRange" runat="server" CssClass="" RepeatDirection="Horizontal" RepeatLayout="Flow">
                <asp:ListItem Text="Last 3 Months" Value="90" Selected="False"></asp:ListItem>
                <asp:ListItem Text="Last 6 Months" Value="180" Selected="False"></asp:ListItem>
                <asp:ListItem Text="Last 12 Months" Value="365" Selected="True"></asp:ListItem>
            </asp:RadioButtonList>        
        </div>
        <div>
            <asp:Label ID="lblSaleType" runat="server" Text="Sales type:"></asp:Label>
            <asp:RadioButtonList ID="rblSaleType" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                <asp:ListItem Text="Regular Sales" Value="false" Selected="true"></asp:ListItem>
                <asp:ListItem Text="Foreclosures" Value="true" Selected="False"></asp:ListItem>
            </asp:RadioButtonList>        
        </div>
        <div class="buttonContainer"><asp:Button ID="Button1" runat="server" Text="Get Comparables" Font-Size="Smaller" OnClick="Button1_Click" /></div>
    </fieldset>

    <asp:ListView ID="lvComps" runat="server" GroupItemCount="1" DataKeyNames="property_id">
        <GroupSeparatorTemplate>
            <div class="groupSeperator">
            </div>
        </GroupSeparatorTemplate>
        <GroupTemplate>
            <div id="itemPlaceHolder" runat="server">
            </div>
        </GroupTemplate>
        <ItemTemplate>
             <span class="itemStyle"> <table>
                    <tr>
                        <td class="td1">
                            <div class="photoHeading"><asp:HyperLink ID="linkProperty" runat="server" 
                            Text='<%# Eval("street_address") %>' 
                            NavigateUrl='<%# "~/Property_Info/Property_Details.aspx?pid=" + DataBinder.Eval(Container.DataItem, "property_id").ToString() %>'></asp:HyperLink></div>
                        </td>
                       <td valign="top" style="width: 70%;" colspan="2">
                        <table>
                                <tr>
                                    <td>
                                        <label class="label">
                                            Transfer Date:
                                        </label>
                                        <%# Eval("Date", "{0:d}") %>
                                    </td>
                                    <td>
                                        <label class="label">
                                            Sale Amount:
                                        </label>
                                        <%# Eval("Sale_Price","{0:c}") %>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td class="td1">
                            <asp:Image ID="imgProperty" ImageUrl="~/images/house_pic.jpg" Width="75px" runat="server" />
                        </td>
                        <td class="td2">
                            <div>
                                <label class="label">
                                    Taxable Value:
                                </label>
                                <%# Eval("taxable_total_val", "{0:c}")%><br />
                                <label class="label">
                                    Acreage:
                                </label>
                                <%# Eval("acreage") %><br />
                                <label class="label">
                                    SqFt:</label>
                                <%# Eval("sq_footage") %>
                            </div>
                        </td>
                        <td class="td2">
                            <div>
                                <label class="label">
                                    Total Rooms:
                                </label>
                                <%#Eval("rooms") %><br />
                                <label class="label">
                                    Bedrooms:
                                </label>
                                <%#Eval("bedrooms") %><br />
                                <label class="label">
                                    Full Baths:
                                </label>
                                <%# Eval("baths") %><br />
                                <label class="label">
                                    Half Baths:
                                </label>
                                <%# Eval("half_baths")%><br />
                                <label class="label">
                                    Fireplace:
                                </label>
                                <%# ConvertToText(Eval("fireplace")) %><br />
                                <label class="label">
                                    Air Conditioning:</label>
                                <%# ConvertToText(Eval("air_conditioning")) %>
                            </div>
                        </td>
                    </tr>       </table>
                </span>  
        </ItemTemplate>
        <AlternatingItemTemplate>
            <span class="altItemStyle">
          <table>
                    <tr>
                        <td class="td1">
                            <div class="photoHeading"><asp:HyperLink ID="linkProperty" runat="server" 
                            Text='<%# Eval("street_address") %>' 
                            NavigateUrl='<%# "~/Property_Info/Property_Details.aspx?pid=" + DataBinder.Eval(Container.DataItem, "property_id").ToString() %>'></asp:HyperLink></div>
                        </td>
                        <td valign="top" style="width: 70%" colspan="2">
                            <table>
                                <tr>
                                    <td>
                                        <label class="label">
                                            Transfer Date:
                                        </label>
                                        <%# Eval("Date", "{0:d}") %>
                                    </td>
                                    <td>
                                        <label class="label">
                                            Sale Amount:
                                        </label>
                                        <%# Eval("Sale_Price","{0:c}") %>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td class="td1">
                            <asp:Image ID="imgAltProperty" ImageUrl="~/images/house_pic.jpg" Width="75px" runat="server" />
                        </td>
                        <td class="td2">
                            <div>
                                <label class="label">
                                    Taxable Value:
                                </label>
                                <%# Eval("taxable_total_val", "{0:c}")%><br />
                                <label class="label">
                                    Acreage:
                                </label>
                                <%# Eval("acreage") %><br />
                                <label class="label">
                                    SqFt:</label>
                                <%# Eval("sq_footage") %>
                            </div>
                        </td>
                        <td class="td2">
                            <div>
                                <label class="label">
                                    Total Rooms:
                                </label>
                                <%#Eval("rooms") %><br />
                                <label class="label">
                                    Bedrooms:
                                </label>
                                <%#Eval("bedrooms") %><br />
                                <label class="label">
                                    Full Baths:
                                </label>
                                <%# Eval("baths") %><br />
                                <label class="label">
                                    Half Baths:
                                </label>
                                <%# Eval("half_baths")%><br />
                                <label class="label">
                                    Fireplace:
                                </label>
                                <%# ConvertToText(Eval("fireplace")) %><br />
                                <label class="label">
                                    Air Conditioning:</label>
                                <%# ConvertToText(Eval("air_conditioning")) %>
                            </div>
                        </td>
                    </tr>       </table>
                </span>
        </AlternatingItemTemplate>
        <LayoutTemplate>
            <div class="layoutRegion">
                <div class="headingRegion">
                    Comparable Sales</div><div id="groupPlaceHolder" runat="server">
                </div>
            </div>
        </LayoutTemplate>
        <ItemSeparatorTemplate>
            <div class="itemSeperator">
            </div>
        </ItemSeparatorTemplate>
    </asp:ListView>
</asp:Content>
